﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Windows.Threading;
using System.Xml;
using Newtonsoft.Json;

namespace DIfmClient
{
    public enum AudioFormat { aac64, aac32, mp396, wma40 };

    public class Channel
    {
        [JsonProperty(PropertyName = "id")]
        public int ID { get; set; }

        [JsonProperty(PropertyName = "key")]
        public string Key { get; set; }

        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        [JsonProperty(PropertyName = "description")]
        public string Description { get; set; }

        [JsonProperty(PropertyName = "playlist")]
        public string Playlist { get; set; }

        public override string ToString()
        {
            return this.Name;
        }

        //public string ChannelTitle { get; set; }
        public List<Track> TrackList { get; set; }

        public Channel()
        {
            TrackList = new List<Track>();
        }

        public void RefreshPlaylist()
        {
            DispatcherTimer dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 10);
            dispatcherTimer.Start();
        }

        void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            //TrackList = 
        }
    }
}
